package com.yinguo.snacks.scheduler;

/**
 * Created by houseme on 2017/10/6 下午10:57.
 * Project scheduler
 * Package com.yinguo.snacks.scheduler
 * File
 */
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@ComponentScan(basePackages = "com.yinguo.snacks.scheduler")
@EnableScheduling
public class SchedulerJobApplication {
    private static Logger logger = LoggerFactory.getLogger(SchedulerJobApplication.class);

    public static void main(String[] args) {
        try {
            SpringApplication.run(SchedulerJobApplication.class, args);
            logger.info("SchedulerJobApplication-api>>>服务启动成功");
            Object lock = new Object();
            synchronized (lock) {
                try {
                    while (true)
                        lock.wait();
                } catch (InterruptedException e) {
                    logger.error(e.getMessage(), e);
                }
            }
        } catch (Exception e) {
            logger.error("SchedulerJobApplication-api>>服务启动失败", e);
            e.printStackTrace();
        }
    }
}